#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1-or-later
set -ex

rpmbuild \
    -bb \
    --noprep \
    --build-in-place \
    $([ "$WITH_TESTS" = "0" ] && echo --nocheck) \
    --define "_topdir /var/tmp" \
    --define "_sourcedir $PWD/rpm" \
    --define "_rpmdir $PACKAGEDIR" \
    --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
    rpm/mkosi.spec
